﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FTradeWarehouseFeeList.aspx.cs" Inherits="IHISCETeim.Web.MachineSys.FTradeModel.FTradeWarehouseFeeList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../EasyUI/themes/default/easyui.css"/>
	<link rel="stylesheet" type="text/css" href="../EasyUI/themes/icon.css" />
	<script type="text/javascript" src="../js/jquery-1.7.2.min.js"></script>   
	<script type="text/javascript" src="../EasyUI/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../EasyUI/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="../EasyUI/easyui-formatter_20140718.js"></script>
     <link href="../themes/css/jquery.autocomplete.css" rel="stylesheet" type="text/css" />
    <script src="../js/DWZ/jquery.autocomplete.js" type="text/javascript"></script>
    <script type="text/javascript">
      

        ///自适应宽高
        $(window).resize(function(){		    
            $("#tab_list").datagrid({
                width: '100%',
                height: $(parent.document).find(".tabsPageContent").height() - 11 > 0 ? $(parent.document).find(".tabsPageContent").height() - 11 : 500,
            }); 
        });

        $(document).ready(function () {
            //权限处理
            var $powers={
                "r查看":<%=HasPowerEasyUI(IHISCETeim.Web.Permission.查看) %>,
                "r导出":<%=HasPowerEasyUI(IHISCETeim.Web.Permission.导出) %>,
                "r新增":<%=HasPowerEasyUI(IHISCETeim.Web.Permission.新增) %>,
                };
            var $tab_toolbar=$("#tab_toolbar");
            $tab_toolbar.find("a").each(function(){
                var $per=$(this).attr("Permission");
                var pt= $powers[$per]==undefined || null?true:$powers[$per];
                $(this).linkbutton(pt?'enable': 'disable');
            })

            //自动完成
            $(".autocomplete").each(function () {
                var $this = $(this);
                var url = unescape($this.attr("autocompletehref"));
                $this.autocomplete(url);
            });
            //条件查询
            $("#search-buttons").find("#btn_search").click(function () {
                var query = $("#tab_search").serializeJSON(); // GetInputData("tab_search", "query");
                query.action = "query";
                $('#tab_list').datagrid("options").queryParams = query;
                $('#tab_list').datagrid('load');
                $("#tab_search").dialog("close");
                return false;
            });

            var lastIndex;
            $('#tab_list').datagrid({               
                url: location.href,
                queryParams: { "action": "query" },
                sortName: 'id', //排序字段
                sortOrder: 'desc', //排序类型
                idField: 'id', //标识字段,主键
                width: '100%', //宽度    
                height: $(parent.document).find(".tabsPageContent").height() - 11 > 0 ? $(parent.document).find(".tabsPageContent").height() - 11 : 500,
                toolbar: "#tab_toolbar"
            });   
        })

        //添加
        function onAddClick() {

            var rel = "FTradeWarehouseFeeEdit";
            var url = "FTradeModel/FTradeWarehouseFeeEdit.aspx";
            var title = "提前结算费用";
            var options = { width: 850, height: 450, max: false, mask: true, maxable: false, minable: false, fresh: true, resizable: false, drawable: true };
            //top.$.pdialog.open(url, rel, title, options);
            top.navTab.openTab(rel, url, { title: title, fresh: true, external: false });
            return false;
        }
        //删除
        function onDelClick() {

            var row = $('#tab_list').datagrid('getSelected')
            if (row == null) {
                $.messager.alert('提示', '请先选择要删除的记录');
                return false;
            }
            $('#tab_list').datagrid('unselectAll')//取消选中,不然会直接选中上次的数据
            var ID = row.ID;


            $.messager.confirm('提示', '您确认要删除此记录吗？', function (r) {
                if (r) {
                    var ID = row.ID;
                    var url = "sysAjaxDone.ashx?ajaxmethod=deleteftradewarehousefee&ID=" + ID;
                    top.ajaxTodo(url, "");
                    $("#tab_list").datagrid("load");

                }
            });


            return false;
        }
        function getQuery()
        {
            var query = $("#tab_search").serializeJSON(); // GetInputData("tab_search", "query");
            query.action = "query";
            return query;
        }
    </script>
     
</head>
<body style="margin:2px;" >
     <div id="tab_search" title="查询条件" style=" height:250px; width:500px;" class="easyui-dialog" modal="true" closed="true" buttons="#search-buttons">
         <table class="table_search" width="100%" style=" line-height:21px;">
            <tr>
                <td>经销商:</td>
                <td Colspan="3"><input  name="JingXiaoShang"  /></td>
              
            </tr>
            <tr>
                <td>机型:</td>
                <td ><input  name="XingHao" value="" /></td>
                  <td>机号:</td>
                <td><input  name="JiHao" value="" /></td>
            </tr>          
            
        </table>
        <div id="search-buttons">
            <a id="btn_search" href="javascript:;" class="easyui-linkbutton" iconcls="icon-search" plain="true">提交</a> 
            <a href="javascript:;" class="easyui-linkbutton" onclick="$('#tab_search').dialog('close');return false;" iconcls="icon-cancel" plain="true">取消</a>
        </div>
    </div>

    <div id="tab_toolbar" style="padding:2px;">
       <a href="#" title="高级查找" class="easyui-linkbutton" iconcls="icon-search" plain="true" onclick="$('#tab_search').dialog('open');" Permission="">查找</a>
       <a href="#"  class="easyui-linkbutton" iconcls="icon-add" plain="true"  onclick="return onAddClick();" Permission="r新增" style="">提前结算费用</a>
       <a href="#" title="删除" class="easyui-linkbutton" iconcls="icon-remove" plain="true" onclick="return　onDelClick();" Permission="r删除">删除</a> 

    </div>   

   <table id="tab_list"   iconCls="" singleSelect="true" idField="ID"  nowrap="false" striped="true" collapsible="false" remoteSort="true"  toolbar="#tab_toolbar"  pagination="true" pageNumber="1" pageSize="<%=numPerPage %>"  pageList="<%=SetnumPerPage() %>" rownumbers="true" showFooter="false" url="">
		<thead>
			<tr>
				<th field="XingHao" width="100px" sortable="true">型号</th>
                <th field="JiHao" width="100px" sortable="true">机号</th>                
				<th field="JingXiaoShang" width="150px" sortable="true">经销商</th>                
                <th field="JinE" width="100px" sortable="true">金额</th>
				<th field="SetDate" width="150px" sortable="true" formatter="formatterdate">结算时间</th>
				
                <th field="SaleDate" width="150px"  sortable="true" formatter="formatterdate">实现销售时间</th>
                <th field="Remark"   sortable="true">备注</th>		
			</tr>
		</thead>
	</table>
</body>
</html>